/**
 * 尝试封装:失败， 没时间·~~~~
 */
var choiceItem = 'notice';
function msgInfo(){
	// 填充内容
	var htmlStr = '';
	var data    = (choiceItem == 'notice') ? resData['list']['article'] : resData['list']['msgList'];
	if(data.length == 0){
		htmlStr += '<div data-v-1dac4918="" class="fullPageMsg">';
		htmlStr += '		<div data-v-1dac4918="" class="fullPageIcon iconfont"> </div>';
		htmlStr += '		<p data-v-1dac4918="">暂无私信</p>';
		htmlStr += '</div>';
		$('.tag_msg_content').html(htmlStr);
		return;
	}
	$.each(data, function (index, value){
		htmlStr += '<div data-v-1dac4918="">';
		htmlStr += '	<div data-v-1dac4918="" class="active tag_show_detail" ami="' + value.id + '" amt="' + choiceItem + '">';
		htmlStr += '		<div data-v-1dac4918="">';
		htmlStr += '			<p data-v-1dac4918="">' + value.title + '</p>';
		htmlStr += '			<div class = "time"><span data-v-1dac4918="">' + value.dateline_format + '</span></div>';
		htmlStr += '		</div>';
		htmlStr += '	</div>';
		htmlStr += '</div>';
	})
	$('.tag_msg_content').html(htmlStr);
}

$('.tag_notice_type').on('click', '', function (){
	$('.tag_notice_type').removeClass('on');
	$(this).addClass('on');
	choiceItem = $(this).index() ? 'msg' : 'notice';
	msgInfo();
})

$('.tag_msg_content').on('click', '.tag_show_detail', function (){
	// 关闭当前主体
	$('.tag_detail_main').hide();
	// 更新展示内容
	var data  = '';
	if($(this).attr('amt') == 'msg'){
		data  = resData['list']['msgList'][$(this).attr('ami')];
	}else{
		data  = resData['list']['article'][$(this).attr('ami')];
	}
	$('.tag_member_article_title').html(data.title);
	$('.tag_member_article_time').html(data.dateline_format);
	$('.tag_member_article_content').html(data.content);
	$('.tag_detail_body').show();
})
$('.tag_detail_close').on('click', '', function (){
	$('.tag_detail_main').show();
	$('.tag_detail_body').hide();
})
window.onload = function (){
	msgInfo();
}